import rxAjax from '@/assets/js/ajax.js';

//权限转移设置表 api接口
export const SysTransferSettingApi = {};

SysTransferSettingApi.baseUrl = '/api-system/system/core/sysTransferSetting';
SysTransferSettingApi.exportUrl = SysTransferSettingApi.baseUrl + '/listExport';

//查询列表
SysTransferSettingApi.query = function (parameter) {
  var url = SysTransferSettingApi.baseUrl + '/query';
  return rxAjax.postJson(url, parameter).then(res => {
    return res.result
  })
}

/**
 * 获取单记录
 * @param pkId
 * @returns {*}
 */
SysTransferSettingApi.get = function (pkId) {
  var url = SysTransferSettingApi.baseUrl + '/get?pkId=' + pkId;
  return rxAjax.get(url);
}

//保存数据
SysTransferSettingApi.save = function (parameter) {
  var url = SysTransferSettingApi.baseUrl + '/save';
  return rxAjax.postJson(url, parameter);
}

//删除数据
SysTransferSettingApi.del = function (parameter) {
  var url = SysTransferSettingApi.baseUrl + '/del';
  return rxAjax.postUrl(url, parameter);
}

SysTransferSettingApi.excuteSelectSql = function (id, authorId) {
  var url = SysTransferSettingApi.baseUrl + '/excuteSelectSql?id=' + id + '&authorId=' + authorId;
  return rxAjax.get(url);
}

SysTransferSettingApi.excuteUpdateSql = function (parameter) {
  var url = SysTransferSettingApi.baseUrl + "/excuteUpdateSql";
  return rxAjax.postJson(url, parameter);
}

SysTransferSettingApi.onRun = function (parameter) {
  var url = SysTransferSettingApi.baseUrl + '/onRun';
  return rxAjax.postForm(url, parameter);
}
export default SysTransferSettingApi;

